import React from 'react';

import BaseExecuter from '../common/BaseExecuter';
import Constants from '../../common/Constants';

export default class PostExecuter extends BaseExecuter {

  execute(action) {
    switch (action.name) {
      case "PostRequestListAction":
        this._requestList(action);
        break;
      case "PostRequestLikeAction":
        this._requestLike(action);
        break;
      case "PostRequestShoucangAction":
        this._requestShoucang(action);
        break;
      case "PostRequestContentAction":
        this._requestContent(action);
        break;
      case "PostRequestMyPostCommentsNumAction":
        this._requestMyPostCommentsNum(action);
        break;
      case "PostRequestNewsFollowCommentsAction":
        this._requestNewsFollowComments(action);
        break;
      case "PostRequestMyPostCommentsAction":
        this._requestMyPostComments(action);
        break;
      case "PostRequestMyPushPostsNumAction":
        this._requestMyPushPostsNum(action);
        break;
      case "PostRequestMyPushPostsAction":
        this._requestMyPushPosts(action);
        break;
    }
  }

  _requestMyPushPostsNum(action) {
    this._sendRequestCommonResponse(action, "requestMyPushPostsNum");
  }

  _requestMyPushPosts(action) {
    this._sendRequestCommonResponse(action, "requestMyPushPosts");
  }

  _requestMyPostComments(action) {
    this._sendRequestCommonResponse(action, "requestMyPostComments");
  }

  _requestNewsFollowComments(action) {
    this._sendRequestCommonResponse(action, "requestNewsFollowComments");
  }

  _requestMyPostCommentsNum(action) {
    this._sendRequestCommonResponse(action, "requestMyPostCommentsNum");
  }

  _requestShoucang(action) {
    this._sendRequestCommonResponse(action, "requestShoucang");
  }

  _requestLike(action) {
    this._sendRequestCommonResponse(action, "requestLike");
  }

  _requestList(action) {
    this._sendRequestCommonResponse(action, "requestList");
  }

  _requestContent(action) {
    this._sendRequestCommonResponse(action, "requestContent");
  }

  _getModuleType() {
    return Constants.MODULE_TYPE.POST;
  }
}
